#include "BtrixGame.h"
#include "DXUT.h"
#include "MainScene.h"
CBtrixGame::CBtrixGame( void )
{




}
CBtrixGame::~CBtrixGame(void)
{



}

HRESULT CBtrixGame::OnInitialize( void )
{
	Singleton<CGame>::Instance()->AddDeviceStateDeposit(Singleton<CGraphicsResourceManager>::Instance());
	Singleton<CGame>::Instance()->AddDeviceStateDeposit(Singleton<CPrimiteRender>::Instance());
	Singleton<CGame>::Instance()->AddDeviceStateDeposit(Singleton<CScreenSquare>::Instance());
	Singleton<CGame>::Instance()->AddUpdateDeposit(Singleton<CSceneManager>::Instance());
	Singleton<CGame>::Instance()->AddRenderDeposit(Singleton<CSceneManager>::Instance());
	Singleton<CGame>::Instance()->AddMsgProcessorDeposit(Singleton<CSceneManager>::Instance());
	Singleton<CGame>::Instance()->AddTerminateDeposit(Singleton<CSceneManager>::Instance());
	Singleton<CSceneManager>::Instance()->AddScene(Singleton<CMainScene>::Instance()); 
	Singleton<CGame>::Instance()->AddRenderDeposit(this);

	return S_OK;
}

void CBtrixGame::OnTerminate( void )
{

}

void CBtrixGame::OnD3D9FrameRender( float fElapsedTime )
{
	if(Singleton<CInput>::Instance()->GetKeyboard()->IsKeyUp(DIK_ESCAPE))
		
	{
		 
		if(!Singleton<CSceneManager>::Instance()->ExitTopScene())
			PostQuitMessage(0);
	}

	



}
